﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WCS.Infrastructure.Dto.Common;

namespace WCS.Infrastructure.Dto.Request.Payment
{
    /// <summary>
    /// 提现记录表
    /// </summary>
    public class WithdrawalRecordRequestDto:BaseRequestDto
    {

        /// <summary>
        /// 提现记录ID
        /// </summary>
        [Key]
        [StringLength(32)]
        public string? Id { get; set; } = null!;

        /// <summary>
        /// 提现编号
        /// </summary>
        [StringLength(32)]
        public string? WithdrawalNo { get; set; } = null!;

        /// <summary>
        /// 关联用户ID
        /// </summary>
        [StringLength(32)]
        public string? UserId { get; set; } = null!;

        /// <summary>
        /// 关联提现账户ID
        /// </summary>
        [StringLength(32)]
        public string? WithdrawalAccountId { get; set; } = null!;

        /// <summary>
        /// 关联账户交易记录ID（对应AccountTransaction中Type=3的记录）
        /// </summary>
        [StringLength(32)]
        public string? AccountTransactionId { get; set; } = null!;

        /// <summary>
        /// 提现申请金额
        /// </summary>
        public long? Amount { get; set; }

        /// <summary>
        /// 原始可提现金额（提现前账户中可提现余额的扣减基数）
        /// </summary>
        public long? OriginAmount { get; set; }

        /// <summary>
        /// 提现手续费（由平台或第三方收取）
        /// </summary>
        public long? Fee { get; set; }

        /// <summary>
        /// 提现涉及的税费（如适用）
        /// </summary>
        public long? Tax { get; set; }

        /// <summary>
        /// 实际到账金额（Amount - Fee - Tax）
        /// </summary>
        public long? ActualAmount { get; set; }

        /// <summary>
        /// 提现状态：0=待审核,1=审核通过,2=提现处理中,3=提现成功,4=提现失败,5=已取消,6=审核拒绝
        /// </summary>
        public int? Status { get; set; }

        /// <summary>
        /// 提现申请时间
        /// </summary>
        [Column(TypeName = "timestamp(6) without time zone")]
        public DateTime? ApplyTime { get; set; }

        /// <summary>
        /// 审核通过/拒绝时间
        /// </summary>
        [Column(TypeName = "timestamp(6) without time zone")]
        public DateTime? AuditTime { get; set; }

        /// <summary>
        /// 提交第三方支付处理的时间
        /// </summary>
        [Column(TypeName = "timestamp(6) without time zone")]
        public DateTime? ProcessTime { get; set; }

        /// <summary>
        /// 提现成功到账时间
        /// </summary>
        [Column(TypeName = "timestamp(6) without time zone")]
        public DateTime? SuccessTime { get; set; }

        /// <summary>
        /// 提现失败原因（如：账户信息错误、余额不足、第三方支付失败等）
        /// </summary>
        [StringLength(1024)]
        public string? FailureReason { get; set; }

        /// <summary>
        /// 第三方支付系统交易ID（如微信/支付宝的提现单号）
        /// </summary>
        [StringLength(64)]
        public string? ExternalTransactionId { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [StringLength(512)]
        public string? Remark { get; set; }

        /// <summary>
        /// 扩展属性
        /// </summary>
        public string? ExtraProperties { get; set; }




        ////////////////////////////////////////////////////////////////////////////////////


    }
}
